package com.ycw.service.wang.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ycw.bean.QuestionOther;
import com.ycw.dao.QuestionOtherMapper;
import com.ycw.service.wang.QuestionOtherService;


@Service
public class QuestionOtherServiceImpl implements QuestionOtherService {
	@Autowired
	QuestionOtherMapper questionOtherMapper;

	@Override
	public List<QuestionOther> getAllQuestionOther() {
		List<QuestionOther> question = questionOtherMapper.selectAll();
		return question;
	}

	@Override
	public boolean addQuestionOther(QuestionOther question) {
		int i = questionOtherMapper.insertSelective(question);
		if (i > 0) {
			return true;
		}
		return false;
	}

	@Override
	public boolean updateQuestionOther(QuestionOther question) {
		int i = questionOtherMapper.updateByPrimaryKeySelective(question);
		if (i > 0) {
			return true;
		}
		return false;
	}

	@Override
	public boolean deleteQuestionOther(QuestionOther question) {
		int i = questionOtherMapper.deleteByPrimaryKey(question);
		if (i > 0) {
			return true;
		}
		return false;
	}

	
	@Override
	public QuestionOther getNewsById(QuestionOther question) {
		question=questionOtherMapper.selectOne(question);
		
		return question;
	}
}
